import request from '@/utils/request'
// 获取添加sku的数据
// /admin/product/spuImageList/{spuId}  图片
// /admin/product/spuSaleAttrList/{spuId}  销售属性
// /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}  平台属性
export const reqSpuImageList = (spuId) => {
  return request.get(`/admin/product/spuImageList/${spuId}`) // 获取图片数据
}
export const reqSpuSaleAttrList = (spuId) => {
  return request.get(`/admin/product/spuSaleAttrList/${spuId}`) // 获取销售属性
}
export const reqAttrInfoList = (category1Id, category2Id, category3Id) => {
  return request.get(`/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`) // 获取平台属性
}

// 添加sku
// /admin/product/saveSkuInfo
export const reqAddSku = (skuInfo) =>{
  return request.post('/admin/product/saveSkuInfo',skuInfo)
}
// 获取sku列表数据的接口
export const reqSkuList = (spuId) =>{
  return request.get(`/admin/product/findBySpuId/${spuId}`)
}

// sku列表的接口
export const reqSkuList1 = (page,limit)=>{
  return request.get(`/admin/product/list/${page}/${limit}`)
}
// 上架
export const reqSale = (skuId)=>{
  return request.get(`/admin/product/onSale/${skuId}`)
}
// 下架
export const reqCancel = (skuId)=>{
  return request.get(`/admin/product/cancelSale/${skuId}`)
}
// 获取sku详情的接口
export const reqSkuById = (skuId)=>{
  return request.get(`/admin/product/getSkuById/${skuId}`)
}
// 删除sku
export const reqDel = (skuId) => {
  return request.delete(`/admin/product/deleteSku/${skuId}`)
}